package com.genghis.ptas.autocomplete;

import com.genghis.core.autocomplete.entity.AutoCompleteParam;
import com.genghis.core.autocomplete.entity.AutoCompleteVO;
import com.genghis.core.autocomplete.service.AutoCompleteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * AutoCompleteController
 *
 * @author gaoxinyu
 * @version 1.0.1
 */
@Controller
@RequestMapping("/autoComplete")
public class AutoCompleteController {

    @Autowired
    private AutoCompleteService autoCompleteService;

    @RequestMapping
    @ResponseBody
    public List<AutoCompleteVO> autoComplete(AutoCompleteParam autoCompleteParam) {
        return autoCompleteService.getAutoCompleteResultList(autoCompleteParam);
    }

}
